<?php
include('../../../__global.php');

class person_setting extends ml_controller
{
    public function init()
    {
        $this->set_access(self::ACCESS_SELF , self::NOACCESS_REDIRECT );
    }
    public function initParam()
    {
    }
    public function checkParam()
    {

    }
    public function main()
    {
        ml_tool_actionlog::add_other_action($this->__visitor['uid'] , ML_SINAACTCODE_VIEW_SET_PERSON);
        
        //从session里面取得
        //$data['email'] = $this->__visitor['email'];
        $data['nickname'] = $this->__visitor['nickname'];
        $uid = $this->__visitor['uid'];
        $extData = array();
        $briefData = array();

        $oBrief = new ml_model_dbUserBriefInfo();
        $oExt = new ml_model_dbUserExtInfo();
        $user = new ml_model_dbUserAccount();

        $oExt->getPersonByUid($uid);
        $oBrief->getPersonByUid($uid);
        $user->getAccountById($uid);
        
        $extData = $oExt->get_data();
        $briefData = $oBrief->get_data();
        $userData = $user->get_data();
        
        $data['email'] = $userData['email'];
        
        $info = $extData;
        $info['email'] = $userData['email'];
         
        if(!empty($briefData)){
                $info = array_merge($info, $briefData);
        }
        $this->set_scope_var('person_setting' , $info);

        $data['title'] = '个人设置—个人信息';
        $this->page_output('user::setting::person_setting' , $data);
    }
}
new person_setting();